package moe.oil.db.api;

import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/db")
@Log4j2
public class TestController {

    @Value("${spring.redis.host}")
    String host;

    @GetMapping("/{id}")
    public String test(@PathVariable("id") Integer id) {
        if (id != 0) {
            return "Hello World " + host;
        } else {
            return "test";
        }
    }

}

